const { exec,escape } = require('../db/mysql');
const addNewPoint = async (createTime, content) => {

  const sql = `insert into timeline (createtime, content) values ('${createTime}', '${content}')`;
  try {
    var result = await exec(sql);
  }catch (err) {
    console.log('err ==== ', err);
    return false;
  }
  return result;
};

const getTimeLine = async () => {
  const sql = `select * from timeline`;
  return await exec(sql);
};
module.exports = {
  addNewPoint,
  getTimeLine
};